// 生成文章
import { generate } from './lib/generate.js'
// 加载语料库
import { loadCorpus } from './lib/corpus.js'
import { writeFileSync } from 'fs'
import { createRandomPicker } from './lib/random.js'

const corpus = loadCorpus('./corpus/data.json')

function fn() {
  const title = createRandomPicker(corpus.title)()
  const res = generate(title, { corpus, min: 1500, max: 2000 })
  writeFileSync(`./output/${title}`, res.join('\n'));
}
export default fn

// console.log(res);
